package com.persagy.iot.app

import com.persagy.iot.bean.IOTData
import org.apache.flink.streaming.api.scala.function.WindowFunction
import org.apache.flink.streaming.api.windowing.windows.TimeWindow
import org.apache.flink.util.Collector

class IOTWindowResult() extends WindowFunction[IOTData, IOTData, String, TimeWindow]{
  override def apply(key: String,
                     window: TimeWindow,
                     input: Iterable[IOTData],
                     out: Collector[IOTData]): Unit = {
    out.collect(input.head)
  }
}
